<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <link rel="stylesheet" href="../../frame/layer-v2.0/skin/layer.css">
  <link href="../../frame/bootstrap3/css/bootstrap.css" rel="stylesheet" type="text/css"/>
  <link href="../../frame/angular/ui/animate/nga.all.min.css" rel="stylesheet" type="text/css"/>
  <link href="../../frame/angular/css/common.css" rel="stylesheet" type="text/css"/>
  <script src="../../javascript/jquery-1.9.1.min.js"></script>
  <script src="../../frame/layer-v2.0/layer.js"></script>
  <script src="../../frame/angular/base/angular.js" type="text/javascript"></script>
  <script src="../../frame/bootstrap3/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="../../frame/angular/base/angular-animate.min.js"></script>
  <script src="../../javascript/ngFilterModule.js" type="text/javascript"></script>
  <script type="text/javascript"
          src="../../frame/angular/ui/tm.pagination/tm.pagination.js"></script>
  <script src="../../js/angular/05-17.js"></script>
</head>
<body ng-app="userApp" ng-controller="userCtrl">
<button class="btn btn-info col-md-1 col-md-offset-10" type="button" ng-click="showModal()">添加用户</button>
<table class="table table-bordered table-hover" id="tb" style="margin: 2px">
  <tr>
    <th>序号</th>
    <th>账号</th>
    <th>姓名</th>
    <th>角色</th>
    <th>性别</th>
    <th>部门</th>
    <th>电话</th>
    <th>邮箱</th>
    <th>身份证号</th>
    <th>启用状态</th>
    <th>添加时间</th>
    <th>操作</th>
  </tr>
  <tr ng-repeat="i in page.content" class="active">
    <td ng-bind="$index+1"></td>
    <td ng-bind="i.account"></td>
    <td ng-bind="i.perName"></td>
    <td ng-bind="i.role===1?'普通':'领导'"></td>
    <td ng-bind="i.sexCode===1?'女':'男'"></td>
    <td ng-bind="i.department.name"></td>
    <td ng-bind="i.mobile"></td>
    <td ng-bind="i.email"></td>
    <td ng-bind="i.citID"></td>
    <td ng-bind="i.useMark==1?'启用':'禁用'"></td>
    <td ng-bind="i.addDateTime|date:'yyyy-MM-dd HH:mm:ss'"></td>
    <td>
      <a title="编辑" ng-click="showModal(i.id)"  class="btn btn-success btn-sm">
        <span class="glyphicon glyphicon-pencil"></span>
      </a>
      <a title="删除" ng-click="delete(i.id)"  class="btn btn-danger btn-sm">
        <span class="glyphicon glyphicon-trash"></span>
      </a>
      <a title="{{i.useMark==1?'禁用':'启用'}}" ng-click="changeStatus(i.id,i.useMark)" class="btn btn-info btn-sm">
        <span  ng-class="i.useMark==1?'glyphicon glyphicon-ok-circle':'glyphicon glyphicon-ban-circle'"></span>
      </a>
    </td>
  </tr>
</table>

<!--分页-->
<tm-pagination conf="page"></tm-pagination>

<!--弹框-->
<div style="float: left;top: 1px; position: absolute;left: 475px;" tabindex="-1" role="dialog" ng-show="ifShow">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
          aria-hidden="true" ng-click="closeModel()">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel" ng-bind="title"></h4>
      </div>
      <div class="modal-body">
        <form class="form-horizontal">
          <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">账号</label>
            <div class="col-sm-10">
              <input type="text" ng-model="account" class="form-control" id="account" placeholder="账号">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">身份证</label>
            <div class="col-sm-10">
              <input type="text" ng-model="citID" class="form-control" placeholder="身份证">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">电话</label>
            <div class="col-sm-10">
              <input type="text" ng-model="mobile" class="form-control" placeholder="电话">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">角色</label>
            <div class="radio">
              <label>
                <input type="radio" ng-model="role" name="role" id="admin" value="1">普通员工
              </label>
              <label>
                <input type="radio" ng-model="role" name="role" id="teacher" value="2">领导
              </label>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">性别</label>
            <div class="radio">
              <label>
                <input type="radio" ng-model="sexCode" name="sexCode" value="1">女
              </label>
              <label>
                <input type="radio" ng-model="sexCode" name="sexCode" value="2">男
              </label>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">姓名</label>
            <div class="col-sm-10">
              <input type="text" ng-model="perName" class="form-control" id="username" placeholder="姓名">
            </div>
          </div>
          <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">Email</label>
            <div class="col-sm-10">
              <input type="text" ng-model="email" class="form-control" id="inputEmail3" placeholder="Email">
            </div>
          </div>
          <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">所属部门</label>
            <div class="col-sm-10">
              <select id="cur" class="form-control" ng-options="i.id as i.name for i in listDep" ng-model="depId">
                <option value="">请选择</option>
              </select>
            </div>
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="closeModel()">关闭</button>
        <button type="button" class="btn btn-primary" id="save" ng-click="save()">保存</button>
      </div>
    </div>
  </div>
</div>
</body>
</html>
